package com.sh169.pojos;

import java.util.Date;
import java.util.List;

import org.nutz.dao.entity.annotation.Column;
import org.nutz.dao.entity.annotation.Id;
import org.nutz.dao.entity.annotation.ManyMany;
import org.nutz.dao.entity.annotation.Name;
import org.nutz.dao.entity.annotation.Table;

@Table("sh_user")
public class User extends BasePojo{

	public static final short STATE_DISABLE = 0;
	public static final short STATE_VERIFY = 1;
	public static final short STATE_SUCCESS = 2;
	
	public static final short TYPE_USER = 0;
	public static final short TYPE_VENDOR = 1;
	
	private static final long serialVersionUID = -7020462507121127163L;
	@Column
	@Id
	private Integer id;
	@Column
	@Name
	private String username;
	@Column("nickname")
	private String nickName;
	@Column
	private String password;
	@Column
	private String email;
	@Column
	private String address;
	@Column
	private String phone;
	@Column
	private String telephone;
	@Column("registip")
	private String registIp;
	@Column("registtime")
	private Date registTime;
	@Column("lastloginip")
	private String lastLoginIp;
	@Column("lastlogintime")
	private Date lastLoginTime;
	@Column("verifykey")
	private String verifyKey;
	@Column("userstate")
	private short state;
	@Column("usertype")
	private short type;
	@ManyMany(target=Role.class,relation="sh_role_user_relation",from="userid",to="roleid")
	private List<Role> roles;
	
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getNickName() {
		return nickName;
	}
	public void setNickName(String nickName) {
		this.nickName = nickName;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	public String getUsername() {
		return username;
	}
	public void setUsername(String username) {
		this.username = username;
	}
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	public String getAddress() {
		return address;
	}
	public void setAddress(String address) {
		this.address = address;
	}
	public String getPhone() {
		return phone;
	}
	public void setPhone(String phone) {
		this.phone = phone;
	}
	public String getTelephone() {
		return telephone;
	}
	public void setTelephone(String telephone) {
		this.telephone = telephone;
	}
	public String getRegistIp() {
		return registIp;
	}
	public void setRegistIp(String registIp) {
		this.registIp = registIp;
	}
	public Date getRegistTime() {
		return registTime;
	}
	public void setRegistTime(Date registTime) {
		this.registTime = registTime;
	}
	public String getLastLoginIp() {
		return lastLoginIp;
	}
	public void setLastLoginIp(String lastLoginIp) {
		this.lastLoginIp = lastLoginIp;
	}
	public Date getLastLoginTime() {
		return lastLoginTime;
	}
	public void setLastLoginTime(Date lastLoginTime) {
		this.lastLoginTime = lastLoginTime;
	}
	public String getVerifyKey() {
		return verifyKey;
	}
	public void setVerifyKey(String verifyKey) {
		this.verifyKey = verifyKey;
	}
	public short getState() {
		return state;
	}
	public void setState(short state) {
		this.state = state;
	}
	public short getType() {
		return type;
	}
	public void setType(short type) {
		this.type = type;
	}
	public List<Role> getRoles() {
		return roles;
	}
	public void setRoles(List<Role> roles) {
		this.roles = roles;
	}
}
